/**
* @brief 角色布阵信息，现在有大量阵型在redis里playerinfo里面，如果有能力，可以移到这里来
* 现在存储的时候组队战需要的阵型
*/
#ifndef _ROLE_FIGHT_SQUARE_H_
#define _ROLE_FIGHT_SQUARE_H_

#include <unordered_map>
#include <stdint.h>

#include "../../3rd/libjson/json.h"

#define MAX_SQUARE_NUM 6	//最多出阵英雄数

class Player;


enum EFightSquareType
{
	e_team_square = 1,	//队伍boss阵型
};

// 一个阵型
class CFightSquare
{
public:
	CFightSquare();
	bool ReadFromJson(const Json::Value& data_json);
	bool WriteToJson(Json::Value& data_json);
	bool FillToJson(Json::Value& data_json);

	bool makeupFromJson(const Json::Value& data_json);
	bool isEmpty();
	int32_t GetSquareHeroId(int32_t index);
private:
	int32_t fight_square_[MAX_SQUARE_NUM];	//英雄ID
};

class CRoleFightSquare
{
public:

	CRoleFightSquare();
	~CRoleFightSquare();

	bool ReadFromJson(const Json::Value& data_json);
	bool WriteToJson(Json::Value& data_json);

	int32_t SetSquare(EFightSquareType fight_type, CFightSquare& fightsquare);
	CFightSquare* GetSquareByType(EFightSquareType fight_type);
private:

	std::unordered_map<int32_t, CFightSquare> role_fight_square_;
};

#endif

